﻿@model LoginModel
@using Nop.Web.Models.Customer;
@using Nop.Core;
@using Nop.Core.Infrastructure;
@{
    //register URL with return URL (if specified)
    var registerUrl = Url.RouteUrl("Register");
    if (!String.IsNullOrEmpty(this.Context.Request.QueryString["returnUrl"]))
    {
        var webHelper = EngineContext.Current.Resolve<IWebHelper>();
        registerUrl = webHelper.ModifyQueryString(registerUrl, "returnurl=" + HttpUtility.UrlEncode(this.Context.Request.QueryString["returnUrl"]), null);
    }
}
@using (Html.BeginForm("Login", "Customer", FormMethod.Post))
{
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="myModalLabel">@T("Windalert.Login.RegisterMessage")</h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-md-12">
                            <a href="@Url.RouteUrl("Plugin.ExternalAuth.Facebook.Login", new { ReturnUrl = HttpContext.Current.Request.QueryString["ReturnUrl"] })">
                                <div class="auth-btn auth-btn-facebook" style="width: 250px;">
                                    <span class="icon"></span>
                                    <span class="message">@T("Windalert.Login.LoginwithFacebook")</span>
                                </div>
                            </a>
                        </div>
                    </div>
                    <hr />
                    @if (Model.UsernamesEnabled)
                    {
                        <div class="form-group row">
                            <div class="col-md-12">
                                @Html.TextBoxFor(m => m.Username, new { @class = "username form-control", autofocus = "autofocus", placeholder = T("Account.Login.Fields.UserName").Text })
                                <span class="input-group-addon">&#64;</span>
                            </div>
                            @Html.ValidationMessageFor(m => m.Username)
                        </div>
                    }
                    else
                    {
                        <div class="form-group row">
                            <div class="col-md-12">
                                <div class="input-group">
                                    @Html.TextBoxFor(m => m.Email, new { @class = "email form-control", autofocus = "autofocus", placeholder = T("Account.Login.Fields.Email").Text })
                                    <span class="input-group-addon">&#64;</span>
                                </div>
                            </div>
                            @Html.ValidationMessageFor(m => m.Email)
                        </div>
                    }
                    <div class="form-group row">
                        <div class="col-md-12">
                            <div class="input-group">
                                @Html.PasswordFor(m => m.Password, new { @class = "password form-control", placeholder = T("Account.Login.Fields.Password").Text })
                                <span class="input-group-addon fa fa-lock"></span>
                            </div>
                        </div>
                        @Html.ValidationMessageFor(m => m.Password)
                    </div>
                    <div class="form-group reversed">
                        @Html.CheckBoxFor(m => m.RememberMe)
                        @Html.LabelFor(m => m.RememberMe)
                        <span class="forgot-password">
                            @Html.RouteLink(T("Account.Login.ForgotPassword").Text, "PasswordRecovery")
                        </span>
                    </div>
                    @if (Model.DisplayCaptcha)
                    {
                        <div class="form-group row">
                            <div class="col-md-6 col-md-offset-2">
                                <div class="left-to-right">
                                    @Html.Raw(Html.GenerateCaptcha())
                                </div>
                            </div>
                        </div>
                    }
                    <div class="buttons">
                        <input class="button-1 login-button btn btn-default" type="submit" value="@T("Account.Login.LoginButton")" />
                    </div>
                </div>
                <div class="modal-footer">
                    <ul class="" style="float:right">
                        <li>@Html.Action("LanguageSelector", "Common")</li>
                        
                    </ul>
                    <input type="button" class="btn btn-danger" onclick="location.href='@registerUrl    '" value="@T("Windalert.Login.RegisterFree")" />
                </div>
            </div>
        </div>
    </div>
}
